import Vue from 'vue';
import Router from 'vue-router';
import NebulaRouter from './modules/nebula';

const OriginalPush = Router.prototype.push;

// 这个文件 不要 改为ts 文件 改为ts文件这里会报错

Router.prototype.push = function push(location) {
    // if (onResolve || onReject) return OriginalPush.call(this, location, onResolve, onReject)
    return OriginalPush.call(this, location).catch(err => err)
}

Vue.use(Router);

export const CONSTANT_ROUTE = [
    ...NebulaRouter,
    {
        path: '*',
        component: () => import('@/views/login/Login.vue'),
    },
];


export default new Router({
    mode: "history",
    base: '/iccweb/', // 访问 添加路径
    // base: '/iccweb-bohai/',  //访问 添加路径
    routes: CONSTANT_ROUTE,
});


